package com.frxuexi.user

import com.frxuexi.lib_base.BaseEntity
import com.frxuexi.user.entity.ApproveEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {

    @POST("/api/staff/save")
    fun addEmployee(@Body body: RequestBody):Flow<BaseEntity<Any>>

    @POST("/api/user/login")
    fun login(@Body body: RequestBody):Flow<BaseEntity<String>>

    /**
     * 申请请假
     */
    @POST("/api/leave/save")
    fun addApprove(@Body body: RequestBody):Flow<BaseEntity<Any>>


    /**
     * 获取请假列表
     */
    @GET("/api/leave/all")
    fun getApprs(@Query("status")status:String):Flow<BaseEntity<List<ApproveEntity>>>

    /**
     * 审批请假
     */
    @POST("/api/leave/audit")
    fun approve(@Body body: RequestBody):Flow<BaseEntity<Any>>
}